if the castNum of sprite 19 = the number of cast "Query" then
appendText(userKey)
pass()
exit
end if
end if
else
set the soundLevel to value(userKey)
dontPassEvent()
exit
end if
end if
if fortuneTeller() then
if userKey = RETURN then
if the visible of sprite gOkaySprite = 1 then
dontPassEvent()
exit
else
if the frame >= label("Query") then
if pressButton(gOkaySprite - 1, 1) then
go("No Query")
end if
dontPassEvent()
else
pass()
exit
end if
end if
else
if the castNum of sprite 19 = the number of cast "Query" then
if (userKey >= "A") and (userKey <= "Z") then
appendText(userKey)
pass()
exit
end if
if (userKey = " ") or (userKey = "-") or (userKey = "/") or (userKey = ".") or (userKey = "!") or (userKey = "?") or (userKey = ":") or (userKey = ";") then
appendText(userKey)
pass()
exit
end if
if charToNum(userKey) = 8 then
deleteText(userKey)
pass()
exit
end if
dontPassEvent()
end if
end if
end if
end
on appendText userKey
set gUserName to the text of cast "Query"
if the number of chars in gUserName < 30 then
set gUserName to gUserName & userKey
set the text of cast "Query" to gUserName
updateStage()
else
end if
end
on deleteText userKey
if charToNum(userKey) = 8 then
set gUserName to the text of cast "Query"
delete char -30000 of gUserName
set the text of cast "Query" to gUserName
updateStage()
end if
end
on programmersKey
return the shiftDown and the controlDown
end
on fortuneTeller
return (the frame >= label("Query")) and (the frame < label("No Query"))
end
on delayFor howLong, interrupt
set howLong to howLong + the timer
if voidp(interrupt) then
repeat while the timer < howLong
nothing()
end repeat
else
repeat while (the timer < howLong) and the mouseUp
nothing()
end repeat
if interrupt > 0 then
puppetTransition(0)
go(interrupt)
end if
end if
end
on checkRange originalNumber, minValue, maxValue
if originalNumber < minValue then
set originalNumber to minValue
else
if originalNumber > maxValue then
set originalNumber to maxValue
end if
end if
return originalNumber
end
on setProp startSprite, stopSprite, whichProperty, whichValue
repeat with x = startSprite to stopSprite
do("set the " & whichProperty & " of sprite x=whichValue")
end repeat
end
on legalButton whichSprite
repeat while the mouseDown
nothing()
end repeat
return 1
end
on invertButton whichSprite
puppetTransition(0)
set oldInk to the ink of sprite whichSprite
set the ink of sprite whichSprite to 4
updateStage()
delayFor(20)
repeat while the stillDown
if rollOver(whichSprite) then
set the ink of sprite whichSprite to 4
else
set the ink of sprite whichSprite to oldInk
end if
updateStage()
end repeat
if the ink of sprite whichSprite = oldInk then
return 0
exit
end if
set the ink of sprite whichSprite to oldInk
return 1
end
on pressButton whichSprite, ignoreRollOver
set the loc of sprite whichSprite to point(the locH of sprite whichSprite + 1, the locV of sprite whichSprite + 1)
updateStage()
set the loc of sprite whichSprite to point(the locH of sprite whichSprite + 1, the locV of sprite whichSprite + 1)
updateStage()
set delayFor to the timer + 20
repeat while the mouseDown or (the timer < delayFor)
nothing()
end repeat
if voidp(ignoreRollOver) then
set theResult to rollOver(whichSprite)
else
set theResult to ignoreRollOver
end if
set the loc of sprite whichSprite to point(the locH of sprite whichSprite - 1, the locV of sprite whichSprite - 1)
updateStage()
set the loc of sprite whichSprite to point(the locH of sprite whichSprite - 1, the locV of sprite whichSprite - 1)